package com.colin.app.app;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.colin.app.R;
import com.colin.library.base.BaseFragment;

/**
 * Created by Colin on 2017/1/15.
 */

public  abstract class AppFragment extends BaseFragment{

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }


    @Override
    protected void onFirstUserVisible() {
    }

    @Override
    protected void onUserVisible() {
    }

    @Override
    protected void onUserInvisible() {
    }


    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initAsync() {

    }

    protected View showEmptyView(RecyclerView recyclerView) {
        return showEmptyView(recyclerView, "暂无数据");
    }

    protected View showEmptyView(RecyclerView recyclerView, String msg) {
        View view = LayoutInflater.from(activity).inflate(R.layout.layout_recyclerview_empty, (ViewGroup) recyclerView.getParent(), false);
        TextView textView = (TextView) view.findViewById(R.id.text_recyclerview_empty);
        textView.setText(msg);
        return view;
    }
}
